package com.example.freewood.smartsecurity_manager.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.example.freewood.smartsecurity_manager.R;
import com.example.freewood.smartsecurity_manager.activity.Device.DeviceBackOut;
import com.example.freewood.smartsecurity_manager.activity.Device.LoginDevice;
import com.example.freewood.smartsecurity_manager.utils.TextActionBar;
import com.gc.materialdesign.views.ButtonFlat;
import com.gc.materialdesign.views.ButtonRectangle;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by FreeWood on 16/3/8.
 */
public class LoginActivity extends AppCompatActivity {

    @Bind(R.id.btn_login_login)
    ButtonRectangle btnLoginLogin;
    @Bind(R.id.btn_login_nologin)
    ButtonRectangle btnLoginNologin;
    @Bind(R.id.btn_login_reg)
    ButtonFlat btnLoginReg;
    @Bind(R.id.btn_login_forget)
    ButtonFlat btnLoginForget;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        ButterKnife.bind(this);
        initActionBar();
    }


    @OnClick({R.id.btn_login_login, R.id.btn_login_nologin, R.id.btn_login_reg, R.id.btn_login_forget})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_login_login:
                Intent intent = new Intent();
                intent.setClass(LoginActivity.this, MainActivity.class);
                startActivity(intent);
                finish();
                break;
            case R.id.btn_login_nologin:
                break;
            case R.id.btn_login_reg:
                startActivity(new Intent(LoginActivity.this,RegisterActivity.class));
                break;
            case R.id.btn_login_forget:
                break;
        }
    }

    /**
     * 初始化ActionBar
     */
    private void initActionBar(){
        ActionBar actionBar=getSupportActionBar();
        TextActionBar bar=new TextActionBar(getApplicationContext(),actionBar,"登录平台");
    }
}
